<include file="admin_index@setting_functions" />
<include file="public@admin_head" />
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="#base_setup" data-toggle="tab">{:lang('BASE_SETUP')}</a></li>
            <li><a href="#sms" data-toggle="tab">{:lang('SMS')}</a></li>
            <li><a href="#admin_login_page" data-toggle="tab">{:lang('ADMIN_LOGIN_PAGE')}</a></li>
        </ul>
        <form method="post" class="form-horizontal js-ajax-form margin-top-20"
            action="{:cmf_plugin_url('DferThinkcmfTools://AdminIndex/settingPost')}">
            <input type="hidden" name="id" value="{$id}" readonly>
             {:_parse_plugin_config($data['config'])}
        </form>
    </div>
    <script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
    <script>
        $(() => {
            console.log('{$tab}');
            $('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
                console.log(e);
                var href = $(e.target).attr('href');
                switch (href) {
                    default:
                        break;
                }
            })
            $('a[href=#{$tab}]').tab('show');
        })
        Wind.use('colorpicker', function() {
            $('.js-color').each(function() {
                var $this = $(this);
                $this.ColorPicker({
                    livePreview: true,
                    onChange: function(hsb, hex, rgb) {
                        $this.val('#' + hex);
                    },
                    onBeforeShow: function() {
                        $(this).ColorPickerSetColor(this.value);
                    }
                });
            });

        });

        function doSelectLocation(obj) {
            var $obj = $(obj);
            var title = $obj.data('title');
            var $realInput = $obj;
            var location = $realInput.val();

            parent.openIframeLayer(
                "{:url('dialog/map')}?location=" + location,
                title, {
                    area: GV.IS_MOBILE ? ['100%', '100%'] : ['700px', '90%'],
                    offset: GV.IS_MOBILE ? ['0px', '0px'] : 'auto',
                    btn: ['确定', '取消'],
                    yes: function(index, layero) {
                        var iframeWin = parent.window[layero.find('iframe')[0]['name']];
                        var location = iframeWin.confirm();
                        $realInput.val(location.lng + ',' + location.lat);
                        //$obj.val(location.address);
                        parent.layer.close(index); //如果设定了yes回调，需进行手工关闭
                    }
                }
            );
        }
    </script>
</body>
</html>